package uk.ac.aber.paws.server.db;

/**
 * @author Rob Johnson, Aberystwyth University
 * @email rob.johnson@aber.ac.uk
 * @date 21st May 2012
 * 
 * DBConnectionObject.java
 * 
 * Stores all parameters used to initialise a connection to the database.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
public class DBConnectionObject {

	/**
	 * The type of database server, as required by JDBC driver, may be  MYSQL or SQLSERVER for example
	 */
	private String dbType = null;
	
	/**
	 * The principal database server fqdn
	 */
	private String dbAddress1 = null;
	
	/**
	 * The mirror database server fqdn (if SQL mirroring is in place)
	 */
	private String dbAddress2 = null;
	
	/**
	 * The name of the database in which to connect to
	 */
	private String dbName = null;
	
	/**
	 * The username in which to connect to the database with
	 */
	private String dbUsername = null;
	
	/**
	 * The password in which to connect to the database with
	 */
	private String dbPassword = null;
	
	/**
	 * The port number in which the database server instance is listening on
	 */
	private int dbPort = 0;
	
	public DBConnectionObject(String dbType, String dbAddress1, String dbAddress2, String dbName, String dbUsername, String dbPassword, int dbPort) {
		
		this.dbType = dbType;
		this.dbAddress1 = dbAddress1;
		this.dbAddress2 = dbAddress2;
		this.dbName = dbName;
		this.dbUsername = dbUsername;
		this.dbPassword = dbPassword;
		this.dbPort = dbPort;
	}
	
	public String getDBType() {
		return dbType;
	}
	
	public int getDBPort() {
		return dbPort;
	}
	
	public String getDBAddress1() {
		return dbAddress1;
	}
	
	public String getDBAddress2() {
		return dbAddress2;
	}
	
	public String getDBName() {
		return dbName;
	}
	
	public String getDBUsername() {
		return dbUsername;
	}
	
	public String getDBPassword() {
		return dbPassword;
	}
}
